package com.starlink.client.jd.request;

import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.CommonOrderTraceRequest;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 订单追综入参模型
 * 传参规则详情见京东文档
 * <a href="https://open.jdl.com/#/open-business-document/api-doc/267/1039"/>
 */
@Data
@NoArgsConstructor
public class TraceQueryRequest implements Serializable {
    private static final long serialVersionUID = 3414524411655720431L;
    /**
     * 京东物流运单号，与京东物流订单号必填其一，运单号在下单接口中已返回
     */
    private String waybillCode;
    /**
     * 京东物流订单号，与京东物流运单号必填其一，订单号在下单接口中已返回
     */
    private String orderCode;
    /**
     * 下单来源；https://cloud.jdl.com/#/open-business-document/access-guide/267/54152
     */
    private Integer orderOrigin;
    /**
     * 客户编码；长度1-32
     */
    private String customerCode;

    public CommonOrderTraceRequest toJd4TraceRequest() {
        CommonOrderTraceRequest request = new CommonOrderTraceRequest();
        request.setWaybillCode(this.waybillCode);
        request.setOrderCode(this.orderCode);
        request.setOrderOrigin(this.orderOrigin);
        request.setCustomerCode(this.customerCode);
        return request;
    }
}
